//
//  SPIssueViewController.m
//  Sport
//
//  Created by Cass on 2017/11/23.
//  Copyright © 2017年 Cass. All rights reserved.
//

#import "SPIssueViewController.h"

@interface SPIssueViewController ()<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UITextView *textView;
@property (weak, nonatomic) UILabel *label;
@end

@implementation SPIssueViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.textView.delegate = self;
    self.navigationItem.title = @"发布动态";
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 5, 100, 21)];
    label.textColor = [UIColor grayColor];
    label.text = @"请输入...";
    self.label = label;
    [self.textView addSubview:_label];
}

#pragma mark - UITextViewDelegate -
- (void)textViewDidChange:(UITextView *)textView{
    if (textView.text.length > 0) {
        self.label.hidden = YES;
    }else{
        self.label.hidden = NO;
    }
}
//- (void)textViewDidBeginEditing:(UITextView *)textView {
//    printf("从新开始编辑");
//}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
//    CGPoint point = [[touches anyObject] locationInView:self.view];
    [self.textView resignFirstResponder];
//    self.editing = NO;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
